Skip to content

Conversation

helenul
Copy link
Member

@helenul helenul commented Nov 10, 2026

Changes

Backend

  • Add a myMatches(userId, sort, limit, offset) query that returns one page of the user's matched plants and totalCount, sorted by newest (default), oldest, or name A–Z / Z–A. Newest and oldest use the order of matchedPlantIds, so no date is needed.
  • Replace matchedPlants on User with matchedPlantIds, so only the ids are sent with the user instead of the whole plants with images. Plants that no longer exist are left out and not counted.

Frontend

  • The user fragment only fetches matchedPlantIds. Explore Plants uses them to show whether a plant is matched.
  • My Matches fetches its plants with the new MY_MATCHES query, which is refetched when a match is added or removed and every time the page is opened.
  • My Matches shows the number of matches and a SortMenu above the plants, and Pagination below. If the last plant on a page is removed, the page goes back to the last page with plants.
  • Sort order and page are kept in the URL with useMyMatchesParams. The URL logic is shared with useExploreParams through a new useUrlParams hook.
  • The sort button now has a white background and a minimum width, so it is visible on the pink background and looks the same on both pages.

Tests

  • Backend: myMatches sorting, pagination, deleted plants and unknown users, and the tests updated to matchedPlantIds (100 % coverage).
  • API (e2e): myMatches sorting, pagination and empty pages, and the match tests updated to matchedPlantIds.
  • Component: MyMatchesPage rewritten for the new query, sorting, pages and URL state.
  • UI (e2e): matching 13 plants and checking the count, sorting, pages and that the sort order is kept after a reload.

Documentation

  • Updated related documentation. Also removed the claim in the README that matched plants are shown on the profile page, since they are not.

add a myMatches query that returns one page of the user's matched plants, sorted by newest, oldest or name. Replace matchedPlants on User with matchedPlantIds, so pages that only need to know which plants are matched don't fetch the whole plants. Update backend and API tests.
The user fragment now only fetches matchedPlantIds, so pages that just need to know which plants are matched no longer fetch the whole plants with images. My Matches fetches its plants with the new MY_MATCHES query and is refetched when a match is added or removed. Update tests.
@helenul helenul requested a review from a team as a code owner November 10, 2026 15:38
@helenul helenul linked an issue Nov 10, 2026 that may be closed by this pull request
4 tasks
@helenul helenul requested a review from alexajah November 11, 2026 09:06
Copy link
Member

@alexajah alexajah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@helenul helenul merged commit e70b20c into main Nov 11, 2026
0 of 4 checks passed
@helenul helenul deleted the 121-add-pagination-to-mymatches branch November 11, 2026 09:07
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pagination to MyMatches
2 participants